Function Reference

_AD_GetPasswordExpired

Returns an array of FQDNs of user or computer accounts with expired passwords.

#Include <AD.au3>
_AD_GetPasswordExpired([$sRoot = ""[, $bNeverChanged = False]])

 

Parameters

$sRoot Optional: FQDN of the OU where the search should start (default = "" = search the whole tree)
$bNeverChanged Optional: If set to True returns all accounts who have never changed their password as well (default = False)
$iPasswordAge Optional: Takes the max. password age from the AD or uses this value if > 0
$bComputer Optional: If True queries computer accounts, if False queries user accounts (default = False)

 

Return Value

Success: One-based two dimensional array of FQDNs of accounts with expired passwords
    0 - FQDNs of accounts with expired password
    1 - password last set YYYY/MM/DD HH:NMM:SS UTC
    2 - password last set YYYY/MM/DD HH:NMM:SS local time of calling user
Failure: "", sets @error to:
    1 - No expired passwords found. @extended is set to the error returned by LDAP
    2 - Specified $sRoot does not exist
    3 - $iPasswordAge is not numeric

 

Remarks

None.

 

Related

_AD_IsPasswordExpired, _AD_GetPasswordDontExpire, _AD_SetPassword, _AD_DisablePasswordExpire, _AD_EnablePasswordExpire, _AD_EnablePasswordChange, _AD_DisablePasswordChange, _AD_GetPasswordInfo

 

Example


#AutoIt3Wrapper_AU3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#AutoIt3Wrapper_AU3Check_Stop_OnWarning=Y
; *****************************************************************************
; Example 1
; Get a list of user accounts with expired password
; *****************************************************************************
#include <AD.au3>

; Open Connection to the Active Directory
_AD_Open()
If @error Then Exit MsgBox(16, "Active Directory Example Skript", "Function _AD_Open encountered a problem. @error = " & @error & ", @extended = " & @extended)

; Get a list of user accounts with expired password
Global $aExpired[1]
$aExpired = _AD_GetPasswordExpired()
If @error > 0 Then
    MsgBox(64, "Active Directory Functions - Example 1", "No users with expired passwords could be found")
Else
    _ArrayDisplay($aExpired, "Active Directory Functions - Example 1 - User accounts with expired password")
EndIf

; Close Connection to the Active Directory
_AD_Close()